import 'package:flutter/material.dart';

/*
 * color  : 设置颜色
 * DecorationImage image : 设置图片
 * BoxBorder border ： 设置边框
 * BorderRadiusGeometry borderRadius ： 设置圆角
 * List<BoxShadow> boxShadow  :  阴影，可以指定多个
 * Gradient gradient 渐变
 * BlendMode backgroundBlendMode, //背景混合模式
 * BoxShape shape = BoxShape.rectangle, //形状
 */

class DecoratedBoxDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("装饰容器"),
      ),
      body: Center(
        child: DecoratedBox(
          decoration: BoxDecoration(
              gradient: LinearGradient(
                  colors: [Colors.red, Colors.orange[700]]), //背景渐变
              borderRadius: BorderRadius.circular(3.0), //设置圆角
              boxShadow: [
                BoxShadow(
                    color: Colors.black54,
                    offset: Offset(2.0, 2.0),
                    blurRadius: 4.0)
              ]),
          child: Padding(
            padding: EdgeInsets.symmetric(horizontal: 80.0, vertical: 18.0),
            child: Text(
              "Login",
              style: TextStyle(color: Colors.white),
            ),
          ),
        ),
      ),
    );
  }
}
